﻿#ifndef SETSCRIPTDIALOG_H
#define SETSCRIPTDIALOG_H
#pragma once

#include <qdialog.h>
#include "ObjAutoInject.h"
#include "ui_SetScriptDialogUI.h"
#include "qmessagebox.h"
#include "qevent.h"
#include "QMouseEvent"
#include <qlist.h>

class SetScriptWaitDialog;
class SetScriptLoopDialog;
class Dialog_SetThermostat;
class SetPositionModeDialog;
class SetRateModeDialog;
class TcpCodec_Script;
class SetScriptDialog : public QDialog,public ObjAutoInject
{
  Q_OBJECT

private:
  Ui::SetScriptDialogUI ui;//ui类

  SetScriptWaitDialog* setScriptWaitDialog = Q_NULLPTR;
  SetScriptLoopDialog* setScriptLoopDialog = Q_NULLPTR;
  Dialog_SetThermostat* dialog_SetThermostat = Q_NULLPTR;
  SetPositionModeDialog* setPositionModeDialog = Q_NULLPTR;
  SetRateModeDialog* setRateModeDialog = Q_NULLPTR;
  TcpCodec_Script* tcpCodec_Script = Q_NULLPTR;

public:
  SetScriptDialog(QWidget* parent = Q_NULLPTR);
  ~SetScriptDialog();

signals:

public slots:
  virtual int exec()override;
  virtual void accept()override;

  //对应每个按钮
private slots:
  void slot_openSetPositionModeDialog();
  void slot_openSetRateModeDialog();
  void slot_openDialog_SetThermostat();
  void slot_openSetWaitTimeDialog();
  void slot_openSetLoopDialog();
  void slot_edit();

private:
  void initSignalsAndSlots();
  //geter and seter
public:
  SetScriptWaitDialog* getSetScriptWaitDialog();
  SetScriptDialog* setSetScriptWaitDialog(SetScriptWaitDialog* setScriptWaitDialog);
  SetScriptLoopDialog* getSetScriptLoopDialog();
  SetScriptDialog* setSetScriptLoopDialog(SetScriptLoopDialog* setScriptLoopDialog);
  Dialog_SetThermostat* getDialog_SetThermostat();
  SetScriptDialog* setDialog_SetThermostat(Dialog_SetThermostat* dialog_SetThermostat);
  SetPositionModeDialog* getSetPositionModeDialog();
  SetScriptDialog* setSetPositionModeDialog(SetPositionModeDialog* setPositionModeDialog);
  SetRateModeDialog* getSetRateModeDialog();
  SetScriptDialog* setSetRateModeDialog(SetRateModeDialog* setRateModeDialog);
  TcpCodec_Script* getTcpCodec_Script();
  SetScriptDialog* setTcpCodec_Script(TcpCodec_Script* tcpCodec_Script);
public:
  virtual void objectAutoInjection(QHash<QString,QObject*>* objMap)override;
};

#endif
